package com.ssy.lingxi.after.sale.repository;

import com.ssy.lingxi.after.sale.entity.RepairGoodsDetailDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Set;

/**
 * 维修货物
 * @author 伍将
 * @date 2020/9/8
 * @version 2.0.0
 */
public interface RepairGoodsDetailRepository extends JpaRepository<RepairGoodsDetailDO, Long>, JpaSpecificationExecutor<RepairGoodsDetailDO> {

    /**
     * 根据维修id删除所有维修货物
     * @author 伍将
     * @date 2020/9/8
     * @param repairId:
     * @return void
     **/
    void deleteAllByRepairId(Long repairId);

    /**
     * 根据维修id查询维修商品
     * @param repairId
     * @return
     */
    List<RepairGoodsDetailDO> findByRepairId(Long repairId);
    /**
     * 根据维修id集合查询维修商品
     * @param repairIds
     * @return
     */
    List<RepairGoodsDetailDO> findByRepairIdIn(Set<Long> repairIds);
}
